package models;

public class Weapon extends Item {

	private int DMG_min;
	private int DMG_max;
	private double attackspeed;
	private double hitrating;
	
	public Weapon(String name, int value, int dmgmin, int dmgmax, double atkspd, double hitrt) {
		super(name, value);
		this.DMG_min = dmgmin;
		this.DMG_max = dmgmax;
		this.attackspeed = atkspd;
		this.hitrating = hitrt;
	}
	
	public String toString() {
		String temp = this.name;
		temp = temp + "\n-Base damage: " + DMG_min + "-" + DMG_max;
		temp = temp + "\n-Base attack speed: " + attackspeed;
		temp = temp + "\n-Base hitrating: " + hitrating;
		for(Effect e : effects) {
			temp = temp + "\n---" + e.getStat() + " " + e.getAmmount();
		}
		return temp;
	}

	public int getDMG_min() {
		return DMG_min;
	}
	
	public void setDMG_min(int dmg_min) {
		DMG_min = dmg_min;
		if(DMG_min > DMG_max)
			DMG_max = DMG_min;
	}
	
	public int getDMG_max() {
		return DMG_max;
	}
	
	public void setDMG_max(int dmg_max) {
		DMG_max = dmg_max;
		if(DMG_max < DMG_min)
			DMG_min = DMG_max;
	}
	
	public double getAttackspeed() {
		return attackspeed;
	}
	
	public void setAttackspeed(double attackspeed) {
		this.attackspeed = attackspeed;
	}
	
	public double getHitrating() {
		return hitrating;
	}
	
	public void setHitrating(double hitrating) {
		this.hitrating = hitrating;
	}

}
